//
//  REBaseConst.swift
//  GoGlobalis
//
//  Created by goglobails on 2018/10/8.
//  Copyright © 2018年 Webkul. All rights reserved.
//

import Foundation
import UIKit

//设备宽高、机型
public let REScreenHeight = UIScreen.main.bounds.size.height
public let REScreenWidth = UIScreen.main.bounds.size.width
public let REStatusBarHeight = UIApplication.shared.statusBarFrame.size.height
public let RENaviBarHeight: CGFloat = 44.0


// 设置颜色值
// 通过 十六进制与alpha来设置颜色值  （ 样式： 0xff00ff ）
public func REHexRGB (_ rgbValue :Int) -> UIColor{
    return REHexRGBAlpha(rgbValue, 1.0)
}

public func REHexRGBAlpha (_ rgbValue : Int, _ alpha : Float) -> UIColor {
    return UIColor(red: CGFloat(CGFloat((rgbValue & 0xFF0000) >> 16)/255), green: CGFloat(CGFloat((rgbValue & 0xFF00) >> 8)/255), blue: CGFloat(CGFloat(rgbValue & 0xFF)/255), alpha: CGFloat(alpha))
}

// 通过 red 、 green 、blue 、alpha 颜色数值
public func RERGBAlpa (r: Float, g: Float , b: Float , a: Float ) -> UIColor {
    return UIColor.init(red: CGFloat(CGFloat(r)/255.0), green: CGFloat(CGFloat(g)/255.0), blue: CGFloat(CGFloat(b)/255.0), alpha: CGFloat(a))
}

public func REFontRegular (_ fontSize:CGFloat) -> UIFont {
    return UIFont.init(name: "PingFangSC-Regular", size: fontSize)!
    //return UIFont.init(name: "SourceHanSansCN-Regular", size: fontSize)!
}

public func REFontBold (_ fontSize:CGFloat) -> UIFont {
     return UIFont.init(name: "PingFangSC-Semibold", size: fontSize)!
}

public func RENaviBarColor (_ alpha: Float = 1) -> UIColor {
    return REHexRGBAlpha(0x003680, alpha)
}

public func RESystemColor () -> UIColor {
    return REHexRGB(0x2476e3)
}

public func REBlackColor () -> UIColor {
    return REHexRGB(0x232323)
}

public func REAlertTitleColor () -> UIColor {
    return REHexRGB(0x595959)
}

public func REViewBackgroundColor () -> UIColor {
    return REHexRGB(0xF0F0F0)
}
